/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.front.service;

import java.util.List;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.front.dao.IdealLectureDao;
import com.thinkgem.jeesite.modules.front.entity.IdealLecture;


/**
 * 志愿大讲堂Service
 * @author 朱俊吉
 * @version 2017-11-28
 */
@Service
@Transactional(readOnly = true)
public class IdealLectureService extends CrudService<IdealLectureDao, IdealLecture> {

	public IdealLecture get(String id) {
		return super.get(id);
	}
	
	public List<IdealLecture> findList(IdealLecture idealLecture) {
		return super.findList(idealLecture);
	}
	
	public Page<IdealLecture> findPage(Page<IdealLecture> page, IdealLecture idealLecture) {
		return super.findPage(page, idealLecture);
	}
	
	@Transactional(readOnly = false)
	public void save(IdealLecture idealLecture) {
		//将ckditor文本编辑框内容转换为DOM
		idealLecture.setContent(StringEscapeUtils.unescapeHtml4(idealLecture.getContent()));
		super.save(idealLecture);
	}
	
	@Transactional(readOnly = false)
	public void delete(IdealLecture idealLecture) {
		super.delete(idealLecture);
	}

	public List<IdealLecture> getNewsetIdealLectureList(Integer start, Integer end) {
		
		return dao.getNewsetIdealLectureList(start, end);
	}
	
}